import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-demo7',
  templateUrl: './demo7.component.html',
  styles: [``],
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class Demo7Component {
  value = [new Date('2020-01-13'), new Date('2020-01-15')];
  range = [new Date('2020-01-10'), new Date('2020-01-22')];

  onChange(event) {
    this.value = event;
    console.log('变化后的值是',event)
  };
  
  changeDate() {
    this.range = [new Date('2020-01-12'), new Date('2020-01-20')];
    this.value = [new Date('2020-01-15'), new Date('2020-01-18')];
  }
}